<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta name="baidu-site-verification" content="code-6hr0Fe8kWO" />
    <title th:value="${pictureData.chapterNameName + '' + pictureData.chapterName + ' - ' + '爱看漫画'}"></title>
    <meta name="keywords" th:attr="content=${pictureData.chapterNameName + '' + pictureData.chapterName + '_免费看全部章节'}" />
    <meta name="description" th:attr="content=${pictureData.chapterNameName +  '漫画已更新到最新章节，全集章节目录免费阅读,  下拉式页面清爽简洁，清新干净的文字章节在线阅读，让阅读成为一种享受。'}" />
    <meta itemprop="name" property="og:title" th:attr="content=${pictureData.chapterNameName + '' + pictureData.chapterName + ' - ' + '爱看漫画'}" />
    <meta itemprop="image" property="og:image" th:attr="content=${pictureData.chapterImg}" />
    <meta itemprop="description" property="og:description" th:attr="content=${pictureData.chapterNameName +  '漫画已更新到最新章节，全集章节目录免费阅读,  下拉式页面清爽简洁，清新干净的文字章节在线阅读，让阅读成为一种享受。'}"/>

    <th:block th:include="include :: manhua('')"/>
    <th:block th:include="include :: cartoon-picture-css"/>

    <style type="text/css">

    </style>
</head>
<body>
<!--上导航-->
<div id="top">
    <i class="fa fa-angle-left" onclick="previous()"></i>
    <div id="top-centre"></div>
    <i class="fa fa-angle-right" id="right" onclick="window.open('/manhua/look/index')"></i>
</div>

<div id="mescroll" class="mescroll">
    <article>
        <div class="article-1-box" id="article-1-box">
        </div>
        <div id="null-hint">

        </div>
    </article>
</div>
<!--下导航-->
<div id="bottom">
    <div class="bottom-div" onclick="on()">
        &ensp;<i class="fa fa-angle-left"></i><br>
        <span>上一话</span>
    </div>
    <div class="bottom-div" onclick="catalogueClick()">
        &ensp;<i class="fa fa-align-justify"></i>
        <br>
        <span>目录</span>
    </div>
    <div class="bottom-div" onclick="Un()">
        &ensp;&ensp;&ensp;&ensp;
        <i class="fa fa-angle-right" style="text-align: right;"></i><br>
        <span>下一话</span>
    </div>
</div>
<div id="catalogue">
    <div id="catalogue-div">

        <div id="catalogue-div-left"></div>

        <div id="catalogue-div-cn" onclick="changeClick()"></div>

        <div id="catalogue-div-right" onclick="closeCatalogueClick()"><i class="fa fa-close"></i></div>
    </div>
    <div id="catalogue-scroll">

    </div>

</div>
<th:block th:include="include :: manhua-footer"/>
<th:block th:include="include :: cartoon-picture-js"/>
<script th:inline="javascript">

    /*下拉加载*/
    $(function () {
        let arr = location.href.substring(location.href.lastIndexOf("picture/") + 8).split("/");
        if (nameId === 0 && page === 0) {
            nameId = arr[0];
            page = parseInt(arr[1]);
        }
        //创建MeScroll对象
        var mescroll = new MeScroll("mescroll", {
            down: {
                use: false,//禁用
                auto: false, //是否在初始化完毕之后自动执行下拉回调callback; 默认true
                callback: downCallback //下拉刷新的回调
            },
            up: {
                auto: true, //是否在初始化时以上拉加载的方式自动加载第一页数据; 默认false
                isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点):
                callback: upCallback, //上拉回调,此处可简写; 相当于 callback: function (page) { upCallback(page); }
                toTop: { //配置回到顶部按钮
                    src: "/img/huojian.gif", //默认滚动到1000px显示,可配置offset修改
                    width: "50px",
                    height: "60px",
                    duration: "500"
                    //offset : 1000
                }
            }
        });

        /*下拉刷新的回调 */
        function downCallback() {
            //联网加载数据
            getListDataFromNet(function (data) {
                //联网成功的回调,隐藏下拉刷新的状态
                mescroll.endSuccess();

                //设置列表数据
                setListData(data, false);

            }, function () {
                //联网失败的回调,隐藏下拉刷新的状态
                mescroll.endErr();
            });
        }

        function upCallback() {
            //联网加载数据
            getListDataFromNet(function (curPageData) {

                mescroll.endSuccess(curPageData.length);

                /*上拉*/
                setListData(curPageData, true);
            }, function () {
                //联网失败的回调,隐藏下拉刷新和上拉加载的状态;
                mescroll.endErr();
            });
        }

        /*设置列表数据*/
        function setListData(curPageData, isAppend) {

            if (isAppend) {
                img_box.append(curPageData);//加在列表的后面,上拉加载
            } else {
                //listDom.insertBefore(liDom, listDom.firstChild);//加在列表的前面,下拉刷新
            }

        }

        /*联网加载列表数据
         请忽略getListDataFromNet的逻辑,这里仅仅是在本地模拟分页数据,本地演示用
         实际项目以您服务器接口返回的数据为准,无需本地处理分页.
         * */
        function getListDataFromNet(successCallback, errorCallback) {

            try {
                let html = '';
                if (chater === null) {

                    let pictureData = [[${pictureData}]];

                    if (pictureData['code'] === web_status.SUCCESS) {
                        chater = pictureData['chapterCollect'];
                        let scroll_html = '';
                        /*添加章节*/
                        for (let key in chater) {
                            scroll_html += `<a href="/manhua/look/picture/${chater[key].nameId}/${chater[key].nameOrder}" class="changeClickAll nameOrder-${chater[key].nameOrder}">${chater[key].name}</a>`;
                            chater_length++;
                        }

                        /*最新篇章*/
                        $("#catalogue-div-left").text("最新篇章:" + chater['' + chater_length + ''].name)
                        /*开关标识*/
                        change_switch = change_switch ? false : true;
                        $("#catalogue-div-cn").html('正序<i class="fa fa-angle-down"></i>');
                        /*目录数据添加*/
                        $("#catalogue-scroll").html(scroll_html);
                        /*上导航 篇章名称添加*/
                        $("#top-centre").text(chater['' + page + ''].name)
                        /*保存 第几页...图片*/
                        name_box[page] = pictureData['mhPages'];

                        img_le = name_box[page].length

                        html = assemble();

                        chater_name_json[page] = {min: scroll_numder, name: chater['' + page + ''].name};

                    }

                } else {
                    /*page 第几章*/
                    /*chater_length 数据长度*/
                    /*img_lenght 每次加载的长度*/
                    /*img_le 总长度*/
                    if (page >= chater_length && img_lenght >= img_le && switc) {
                        //隐藏上拉刷新
                        mescroll.hideUpScroll(true);
                        $("#null-hint").html('已经到底了^_^...');
                        return;
                    }


                    /*当篇章漫画总长度等于 每次加载的长度 请求第二章数据*/
                    if (img_lenght >= img_le && switc) {
                        switc = false;
                        html = chater_data(true);
                    } else if (switc) {
                        html = assemble();
                    }
                }
                if (html != '') {
                    //联网成功的回调
                    successCallback && successCallback(html);
                } else {
                    successCallback && successCallback(null);
                }
            } catch (e) {
                //联网失败的回调
                errorCallback && errorCallback();
            }

        }

    });





</script>
<script>
    /*百度统计代码*/
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?3f3cd16bc5ac7aa62b5e84829f76e113";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();

    /*306 自动收入*/
    (function(){
        var src = "https://s.ssl.qhres2.com/ssl/ab77b6ea7f3fbf79.js";
        document.write('<script src="' + src + '" id="sozz"><\/script>');
    })();
</script>
</body>
</html>
